package com.ruixin.mvc.config;

import com.ruixin.base.factory.Factory;

import java.lang.reflect.Method;
import java.lang.reflect.Parameter;

/**
 * web注解实体对象
 */
public class WebMapping {

    private String path;

    private boolean jsonResult;

    private Factory<Method,MethodMapping> methodMappingFactory = new Factory<>();

    public WebMapping(String path, boolean jsonResult) {
        this.path = path;
        this.jsonResult = jsonResult;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public boolean isJsonResult() {
        return jsonResult;
    }

    public void setJsonResult(boolean jsonResult) {
        this.jsonResult = jsonResult;
    }

    public Factory<Method, MethodMapping> getMethodMappingFactory() {
        return methodMappingFactory;
    }

    public void setMethodMappingFactory(Factory<Method, MethodMapping> methodMappingFactory) {
        this.methodMappingFactory = methodMappingFactory;
    }

    public void setMethodMapping(Method method,MethodMapping methodMapping){
        this.methodMappingFactory.put(method,methodMapping);
    }

    public MethodMapping getMethodMapping(Method method){
        return this.methodMappingFactory.get(method);
    }

}
